//
//  HSYBaseViewController+ALAsset.h
//  高仿暴走斗图
//
//  Created by key on 16/6/3.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "HSYBaseViewController.h"
#import <AssetsLibrary/AssetsLibrary.h>

@interface HSYBaseViewController (ALAsset)

//__attribute__((deprecated("Use -rac_openPhotoLibraryWithALAssetType: 该方法更加简便，基于RAC")));

/**
 *  获取资源路径下的图片
 *
 *  @param url          资源路径
 *  @param block        资源图片，缩略图和原图分别为key和value
 *  @param failureBlock 失败的回调
 */
- (void)getAssetForURL:(NSURL *)url index:(NSInteger)index withImageDictionaryBlock:(void(^)(NSDictionary *dic, NSInteger index))block failureBlock:(void(^)(NSError *error))failureBlock;

/**
 *  rac获取设备图片库资源
 *
 *  @param type 资源类型
 *
 *  @return signal信号
 */
- (RACSignal *)rac_openPhotoLibraryWithALAssetType:(kALAssetType)type;

/**
 *  获取某个相薄最后一张图片
 *
 *  @param group 相册夹
 *  @param block 获取到的最后一张图片
 */
- (void)getLastImageByGroup:(ALAssetsGroup *)group usingBlock:(void (^)(UIImage *image))block;

@end
